package com.blb.service.impl;

import com.blb.entity.Warning;
import com.blb.mapper.WarningMapper;
import com.blb.service.IWarningService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blb.utils.ShiroUtils;
import org.springframework.stereotype.Service;


import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ZhengSainan
 * @since 2019-11-21
 */
@Service
public class WarningServiceImpl extends ServiceImpl<WarningMapper, Warning> implements IWarningService {
    @Resource
    private WarningMapper warningMapper;
    /**
     * 查询小于预警值的数据信息
     * @return
     */
    @Override
    public List<Map<String, Object>> getWarningMessage(int start,int length,String ware,String product,String companyId) {
        return warningMapper.getWarningMessage(start, length, ware, product,companyId) ;
    }
    /**
     * 查询信息条数
     * @return
     */
    @Override
    public int warningMessageCount(String ware,String product,String companyId) {
        return warningMapper.warningMessageCount(ware, product,companyId);
    }
    /**
     * 查询仓库
     * @return
     */
    @Override
    public List<String> getWare(String companyId) {
        return warningMapper.getWare(companyId);
    }
    /**
     * 更新预警值
     * @param warning
     */
    @Override
    public void updateWarningNum(Warning warning) {
        warningMapper.updateWarningNum(warning);
    }

    @Override
    public List<Map<String, Object>> getProduct(String companyId) {
        return warningMapper.getProduct(companyId);
    }

    @Override
    public List<Map<String, Object>> getWareId(String companyId) {
        return warningMapper.getWareId(companyId);
    }


}
